package com.cn.gz.liwy.datatype;

import com.cn.gz.liwy.constan.StaticFinal;

public class MyShort extends DataTypeBase implements DataType{

    private short short16;

    private Short aShort;

    public MyShort(){
        setTypeName("short");
        setTypeSize(size());
        setTypeValueRange(valueRange());
        // byte转换为字符串  方法1
        setTypeDefaultVal(defaultValue());
        setTypePacketClass(packetClass());
        new MyShort(this);
        out("============"+getTypeName()+"类型使用规则"+"============");
        commonlyUsed();
        illegalUsed();
        out("==================华丽丽的分割线==================");
    }

    public MyShort (MyShort myShort){
//        将初始好的子类以参数的形式传到父类有参构造
        super(myShort);
    }


    @Override
    public int size() {
        return Short.SIZE;
    }

    @Override
    public String valueRange() {
        return Short.MIN_VALUE + "~" +Short.MAX_VALUE;
    }

    @Override
    public String defaultValue() {
        return Short.toString(short16);
    }

    @Override
    public void commonlyUsed() {

    }

    @Override
    public void illegalUsed() {

    }

    @Override
    public String packetClass() {
        return ""+Short.class;
    }
}
